//
//  CZBarcodeViewController.m
//  小和微博
//
//  Created by 董晓合 on 15/2/16.
//  Copyright (c) 2015年 itcast. All rights reserved.
//

#import "CZBarcodeViewController.h"

@interface CZBarcodeViewController ()
- (IBAction)closeBtnClick:(id)sender;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *barcodeConsY;

@end

@implementation CZBarcodeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    CADisplayLink *link = [CADisplayLink displayLinkWithTarget:self selector:@selector(update)];
    [link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
}

- (void)update {

    self.barcodeConsY.constant -= 5;
    if (self.barcodeConsY.constant <= -124) {
        self.barcodeConsY.constant = 124;
    }
}


- (IBAction)closeBtnClick:(id)sender {
    
    [self dismissViewControllerAnimated:YES completion:nil];
}
@end
